package com.patterns.chainOfResponsibility.commonChain;

/**
 * Created by Xiao Yiyun on 2017/4/28.
 * 场景类
 */
public class Client {
    public static void main(String[] args) {
        //声明所有的处理节点
        Handler handler1 = new ConcreteHandler1();
        Handler handler2 = new ConcreteHandler2();
        Handler handler3 = new ConcreteHandler3();
        //设置责任链顺序
        handler1.setNextHandler(handler2);
        handler2.setNextHandler(handler3);
        handler3.setNextHandler(null);
        //提交请求，返回结果
        Response response = handler1.handleMessage(new Request());
    }
}
